home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / packer / zoo / lzh.h < prev    next >
C/C++ Source or Header  |  1995-03-09  |  991b  |  42 lines

  1. /*$Source: /usr/home/dhesi/zoo/RCS/lzh.h,v $*/
  2. /*$Id: lzh.h,v 1.3 91/07/09 01:39:23 dhesi Exp $*/
  3.  
  4. /*
  5. Adapted from "ar" archiver written by Haruhiko Okumura.
  6. */
  7.  
  8. /* Define some things if they aren't defined in header files */
  9. #ifndef CHAR_BIT
  10. # define CHAR_BIT 8
  11. #endif
  12.  
  13. #ifdef _DCC                 /* Hack around a bug */
  14. #undef UCHAR_MAX
  15. #endif
  16.  
  17. #ifndef UCHAR_MAX
  18. # define UCHAR_MAX 255
  19. #endif
  20.  
  21. /* io.c */
  22.  
  23. extern FILE *arcfile, *lzh_infile, *lzh_infile;
  24. extern t_uint16 bitbuf;
  25. #define BITBUFSIZ (CHAR_BIT * sizeof bitbuf)
  26.  
  27. /* encode.c and decode.c */
  28.  
  29. #define MATCHBIT     8     /* bits for MAXMATCH - THRESHOLD */
  30. #define MAXMATCH 256     /* formerly F (not more than UCHAR_MAX + 1) */
  31. #define THRESHOLD  3     /* choose optimal value */
  32. #define PERC_FLAG ((unsigned) 0x8000)
  33.  
  34. /* huf.c */
  35.  
  36. #define NC (UCHAR_MAX + MAXMATCH + 2 - THRESHOLD)
  37.     /* alphabet = {0, 1, 2, ..., NC - 1} */
  38. #define CBIT 9  /* $\lfloor \log_2 NC \rfloor + 1$ */
  39. #define CODE_BIT    16  /* codeword length */
  40.  
  41. extern ushort left[], right[];
  42.